package org.example.domain.strategy.repository;

import org.example.domain.strategy.model.entity.StrategyAwardEntity;
import org.example.domain.strategy.model.entity.StrategyEntity;
import org.example.domain.strategy.model.entity.StrategyRuleEntity;
import org.example.domain.strategy.model.valobj.RuleTreeVO;
import org.example.domain.strategy.model.valobj.RuleWeightVO;
import org.example.domain.strategy.model.valobj.StrategyAwardRuleModelVO;
import org.example.domain.strategy.model.valobj.StrategyAwardStockKeyVO;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

public interface IStrategyRepository {
    List<StrategyAwardEntity> queryStrategyAwardEntitylist(Long strategyId);

    void storeStrategyAwardSerrchTables(String key, Integer rateRange, HashMap<Integer, Integer> shufflestrategyAwardSearchTables);

    int getRateRange(Long strategyId);

    StrategyEntity queryStrategyEntityBystrategyId(Long strategyId);

    StrategyAwardEntity queryStrategyAwardEntityByAwardId(Long awardId);

    int getRateRange(String key);

    Integer getStrategyAwardAssemble(String key, int rateKey);

    String queryStrategyRuleValue(Long strategyId, String ruleModel);

    String queryStrategyRuleValue(Long strategyId, Integer awardId, String ruleModel);
    StrategyAwardRuleModelVO queryStrategyAwardRuleModel(Long strategyId, Integer awardId);

    StrategyRuleEntity queryStrategyRule(Long strategyId, String ruleModel);


    RuleTreeVO queryRuleTreeVOByTreeId(String ruleModel);

    void storeStrategyAwardCountByawardId(String key, Integer awardCount);

    Boolean subtractionAwardStock(String CasheKey);

    Boolean subtractionAwardStock(String CasheKey, Date endDateTime);

    void awardStockConsumeSendQueue(StrategyAwardStockKeyVO strategyAwardStockKeyVO);

    StrategyAwardStockKeyVO takeQueueValue();

    void updateStrategyAwardStock(Long strategyId, Integer awardId);

    StrategyAwardEntity queryStrategyAwardEntity(Long strategyId, Integer awardId);

    Long queryStrategyIdByactivityId(Long activityId);

    Integer queryUserRaffleActivityDayCount(String userId, Long strategyId);

    Integer queryActivityAccountUseCount(String userId, Long strategyId);

    List<RuleWeightVO> queryAwardRuleWeight(Long strategyId);
}
